<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="box"></div>
</body>
<script>
    /* 找节点 */
    var box = document.getElementById('box');
    var j = 0;//计数器
    var s = 5;
    for (var i = 5; i >= 0; i--) {
        s *= 0.3;//执行条件
        j++;//计数
        if (s < 0.1) {
            box.innerHTML = '经过' + j + '次弹起，篮球弹起的最终高度小于0.1米';
            break;
        }
    }
</script>

</html>